home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9735 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  921 b 

  1. Path: news.iadfw.net!usenet
  2. From: Mark Nelson <markn@airmail.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Please help w/ Stack implementation
  5. Date: Sun, 03 Mar 1996 21:55:24 -0600
  6. Organization: customer of Internet America
  7. Message-ID: <313A69AC.70F@airmail.net>
  8. References: <4hbee8$b6h@wintermute.ecs.fullerton.edu>
  9. NNTP-Posting-Host: dal20-19.ppp.iadfw.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. > But how do I handle Pop()?
  16.  
  17. I don't think there is any good way to return a reference from
  18. Pop().  The STL bypasses this issue by not breaking the reference 
  19. and pop into two separate functions.
  20.  
  21. It should be easy enough to simply return a copy of the top of the
  22. stack, however.  It just means people have to be aware of the
  23. semantics of their copy constructor and assignment operator.
  24.  
  25. Mark Nelson
  26. http://web2.airmail.net/markn
  27.